import { request } from '@ruifox-cms/utils'

//查看所有存储桶
export function bucketSelectAll(params) {
  return request({
    url: '/file/bucket/selectAll',
    method: 'get',
    params
  })
}
//创建存储桶
export function bucketCreate(data) {
  return request({
    url: '/file/bucket/create',
    method: 'post',
    data
  })
}
//存储桶是否存在
export function bucketExists(data) {
  return request({
    url: '/file/bucket/exists',
    method: 'post',
    data
  })
}
//清除桶中数据
export function bucketClear(data) {
  return request({
    url: '/file/bucket/clear',
    method: 'post',
    data
  })
}
//删除存储桶
export function bucketDelete(data) {
  return request({
    url: '/file/bucket/delete',
    method: 'post',
    data
  })
}

//查询bucket中的数据
export function sysFileSelectList(params) {
  return request({
    url: '/file/sysFile/selectList',
    method: 'get',
    params
  })
}
//删除文件
export function sysFileDelete(data) {
  return request({
    url: '/file/sysFile/delete',
    method: 'post',
    data
  })
}
//批量删除
export function sysFileDeleteList(data) {
  return request({
    url: '/file/sysFile/deleteList',
    method: 'post',
    data
  })
}
//下载
export function sysFileDownload(data) {
  return request({
    url: '/file/sysFile/download',
    method: 'post',
    data
  })
}
//获取文件url
export function sysFileGetFileUrl(data) {
  return request({
    url: '/file/sysFile/getFileUrl',
    method: 'post',
    data
  })
}
//文件是否存在
export function sysFileExists(params) {
  return request({
    url: '/file/sysFile/exists',
    method: 'get',
    params
  })
}
//修复文件桶
export function bucketRepair(params) {
  return request({
    url: '/file/bucket/repair',
    method: 'get',
    params
  })
}
